home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / Framewrk / FWPart / Include / FWClpCmd.h < prev    next >
Encoding:
Text File  |  1996-04-25  |  2.9 KB  |  107 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWClpCmd.h
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWCLPCMD_H
  11. #define FWCLPCMD_H
  12.  
  13. #ifndef FWCMD_H
  14. #include "FWCmd.h"
  15. #endif
  16.  
  17. #ifndef FWPASTA_H
  18. #include "FWPasta.h"
  19. #endif
  20.  
  21. // ----- OpenDoc Includes -----
  22.  
  23. #ifndef FWODTYPS_H
  24. #include "FWODTyps.h"
  25. #endif
  26.  
  27. #ifndef SOM_ODDraft_xh
  28. #include <Draft.xh>
  29. #endif
  30.  
  31. //========================================================================================
  32. //    Forward Declarations
  33. //========================================================================================
  34.  
  35. class FW_CPart;
  36. class FW_CFrame;
  37. class FW_CSelection;
  38. class ODClipboard;
  39. class FW_CLinkDestination;
  40.  
  41. //========================================================================================
  42. // FW_CClipboardCommand - handles Cut, Clear, Paste, PasteAs commands
  43. //                          Subclass to make these commands Undo-able
  44. //========================================================================================
  45.  
  46. class FW_CClipboardCommand : public FW_CCommand
  47. {
  48. public:
  49.     FW_DECLARE_AUTO(FW_CClipboardCommand)
  50.  
  51. //----------------------------------------------------------------------------------------
  52. //    Constructors/Destructor
  53. //
  54. public:
  55.     FW_CClipboardCommand(Environment* ev,
  56.                          ODCommandID id,
  57.                          FW_CFrame* frame,
  58.                          FW_Boolean canUndo);
  59.         // Constructor: undo/redo strings = NULL
  60.  
  61.     virtual ~ FW_CClipboardCommand();
  62.  
  63. //----------------------------------------------------------------------------------------
  64. //    Inherited API
  65. //
  66. public:
  67.     // --- Don't override ---
  68.     virtual void         DoIt(Environment* ev);
  69.  
  70.     // --- Override, call Inherited ---
  71.     virtual void         UndoIt(Environment* ev);
  72.     virtual void         RedoIt(Environment* ev);
  73.  
  74. //----------------------------------------------------------------------------------------
  75. //    New API
  76. //
  77. public:
  78.     // --- May override, don't call Inherited ---
  79.     virtual void         PreCommand(Environment* ev);
  80.     virtual void         CommandDone(Environment* ev);
  81.  
  82.     virtual void        Clear(Environment* ev);
  83.     virtual void        Copy(Environment* ev);
  84.     virtual void        Cut(Environment* ev);
  85.     virtual FW_Boolean    Paste(Environment* ev);
  86.     virtual FW_Boolean    PasteAs(Environment* ev);
  87.  
  88. protected:
  89.     FW_CLinkDestination* GetNewLink(Environment* ev) const;
  90.  
  91. private:
  92.     FW_Boolean            PrivPaste(Environment* ev);
  93.     void                PrivCopy(Environment* ev, FW_Boolean allowLink);
  94.  
  95. //----------------------------------------------------------------------------------------
  96. //    Data Members
  97. //
  98. protected:
  99.     ODClipboard*         fClipboard;
  100.     ODUpdateID            fUpdateID;            // update id of clipboard for Cut, Paste
  101.     ODCloneKind            fCloneKind;            // cloneKind of operation
  102.     FW_MPasteAsHandler*    fPasteAsHandler;    // used for Paste As command
  103.     FW_CSelection*        fSelection;
  104. };
  105.  
  106. #endif
  107.